package com.itheima.sc.web.sms;


import com.itheima.sc.result.Result;
import com.itheima.sc.service.sms.SmsCouponHistoryService;
import com.itheima.sc.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {

    @Autowired
    private SmsCouponHistoryService couponHistoryService;


    //根据优惠券id，使用状态，订单编号分页获取领取记录
    @GetMapping("/list")
    public Result couponHistoryList(@RequestParam Map<String,String> param){
     PageResult pageResult=couponHistoryService.couponHistoryList(param);
     return Result.success(pageResult);
    }
}
